from common.poium import Page
from common.vue.label import ElementType as ET
from common.vue.label import ElementBaseLabel
from common.vue.search import VueSearch
from common.vue.button import VueButton
from common.vue.table import VueTable
from common.vue.region import VueRegion
from common.vue.float_window import FloatWindow


class SearchTools(VueSearch):
    region = ElementBaseLabel(ET.REGION, label="区域")
    region_selector = VueRegion(index=0)

    def __init__(self):
        super(SearchTools, self).__init__()


class Table(VueTable):
    add_btn = VueButton("添加")
    upload = VueButton("导入")

    def __init__(self):
        super(Table, self).__init__()


class AddCam(FloatWindow):
    region = ElementBaseLabel(ET.REGION, label="区域")
    region_selector = VueRegion(index=1)

    def __init__(self, title=None, index=None):
        super(AddCam, self).__init__(title=title, index=index)


class Upload(FloatWindow):
    def __init__(self, title=None, index=None):
        super(Upload, self).__init__(title=title, index=index)


class CamListPage(Page):
    searchTools = SearchTools()
    table = Table()
    add_cam = AddCam(title="添加摄像机")
    upload_window = Upload(title="导入")
